﻿#pragma once

#include "Containers/Optional.h"
#include "Path/Path.h"

#include "ApplicationArgument.m.h"


class RFont;

//all argument passed to application when initialize
RSTRUCT()
struct WHENGINE_API SApplicationArgument
{
    ROBJECT

    //absolute path to executable
    //typically this is argv[0] in main(int argc, char* argv[])
    SPath ExecutablePath; 

    //absolute path to content directory,if not set,will use ExecutablePath/Content
    TOptional<SPath> ContentDirectory; 


    //default font engine widget to use
    //if this is null, you can't create any text widget
    //you can create font object by RFontSubsystem::LoadFontFromFile
    SPath DefaultFont;

    //fallback font to use when default font can't render some character
    //if this is null, you can't create any text widget
    //if you only have one font, you can set this to same as DefaultFont
    SPath FallBackFont;

    //if is 0, will create thread count equal to cpu core count-1
    int64_t WorkThreadNum = 4;

    //if this is true,
    //application will start debug server
    //and wait for debugger to attach 
    //bool bStartDebugServer = false;

    //帧率限制，0为不限制。不建议设置太高，因为会导致CPU占用过高和
    //窗口闪烁。窗口闪烁出现在Amd显卡上，原因未知。
    uint64_t FrameLimit=500; 

};